# Contributor: Bart Ribbers <bribbers@disroot.org>

# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=kde-other
maintainer="team/kde <bribbers@disroot.org>"
pkgname=pulseaudio-qt
pkgver=1.6.1
pkgrel=0
# armhf blocked by qt6-qtdeclarative
arch="all !armhf"
url="https://invent.kde.org/libraries/pulseaudio-qt"
pkgdesc="Pulseaudio bindings for Qt"
license="LGPL-2.1-only OR LGPL-3.0-only"
depends_dev="
	glib-dev
	pulseaudio-dev
	qt6-qtbase-dev
	qt6-qtdeclarative-dev
	"
makedepends="$depends_dev
	doxygen
	extra-cmake-modules
	graphviz
	qt6-qttools-dev
	samurai
	"
subpackages="$pkgname-dev $pkgname-doc"
_repo_url="https://invent.kde.org/libraries/pulseaudio-qt.git"
source="https://download.kde.org/stable/pulseaudio-qt/pulseaudio-qt-$pkgver.tar.xz"

build() {
	cmake -B build -G Ninja \
		-DBUILD_WITH_QT6=ON \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_QCH=ON
	cmake --build build
}

check() {
	ctest --test-dir build
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
7bb79bdc77d2fd8d8be569f692fa0f63b3f000fe5db605c38220a572878120ebe505edc272c43f4a3b22c70f44ee2d8cd0a0be3015c3d7660764258eca62b459  pulseaudio-qt-1.6.1.tar.xz
"
